WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WSpinBox",function(C,c,u,j,g,e,i,n,r,s){function o(){return c.readOnly}function t(){var a=f.data("lobj"),b="";if(a!==undefined){b=a.getValue();if(b==="")b=j+"0"+g}else b=c.value;if(b.substr(0,j.length)==j){b=b.substr(j.length);if(b.length>g.length&&b.substr(b.length-g.length,g.length)==g){b=b.substr(0,b.length-g.length);if(s)b=b.split(s).join("");b=b.replace(r,".");return Number(b)}}return null}function v(a){var b=f.data("lobj");if(a>i)if(w){range=i-e;
a=e+(a-e)%(range+1)}else a=i;else if(a<e)if(w){range=i-e;a=i-(Math.abs(a-e)-1)%(range+1)}else a=e;var h=a.toFixed(u);h=h.replace(".",r);var l=h.indexOf(r),k="";if(l!==-1){for(var m=0;m<l;m++){k+=h.charAt(m);if(m<l-1&&(l-m-1)%3===0)k+=s}k+=h.substr(l)}else k=h;h=c.value;if(b!==undefined)b.setValue(j+k+g);else c.value=j+k+g;p=true;D.jsValueChanged(h,a)}function y(){var a=t();if(a!==null){a+=n;v(a)}}function z(){var a=t();if(a!==null){a-=n;v(a)}}jQuery.data(c,"obj",this);var D=this,d=C.WT,f=$(c),q=null,
A,p=false,B=null,x=false,w=false;this.setIsDoubleSpinBox=function(a){x=a;this.configure(u,j,g,e,i,n)};this.setWrapAroundEnabled=function(a){w=a};this.configure=function(a,b,h,l,k,m){u=a;j=b;g=h;e=l;i=k;n=m;B=new (x||typeof d.WIntValidator==="undefined"?d.WDoubleValidator:d.WIntValidator)(true,e,i,"Must be a number","Must be a number","The number must be at least "+e,"The number may be at most "+i)};this.mouseOut=function(){f.removeClass("dn").removeClass("up")};this.mouseMove=function(a,b){if(!o())if(q){a=
d.pageCoordinates(b).y-q.y;b=A;if(b!==null){b-=a*n;v(b)}}else{a=d.widgetCoordinates(c,b);if(f.hasClass("dn")||f.hasClass("up"))f.removeClass("dn").removeClass("up");if(a.x>c.offsetWidth-16){b=c.offsetHeight/2;if(a.y>=b-1&&a.y<=b+1)c.style.cursor="crosshair";else{c.style.cursor="default";a.y<b-1?f.addClass("up"):f.addClass("dn")}}else if(c.style.cursor!="")c.style.cursor=""}};this.mouseDown=function(a,b){d.capture(null);if(!o())if(c.style.cursor=="crosshair"){d.capture(null);d.capture(c);f.addClass("unselectable");
q=d.pageCoordinates(b);A=t()}else{a=d.widgetCoordinates(c,b);if(a.x>c.offsetWidth-16){d.cancelEvent(b);d.capture(c);f.addClass("unselectable");a.y<c.offsetHeight/2?d.eventRepeat(function(){y()}):d.eventRepeat(function(){z()})}}};this.mouseUp=function(a){f.removeClass("unselectable");if(!o()){if(p||q!=null){q=null;p=false;a.onchange()}d.stopRepeat()}};this.keyDown=function(a,b){if(!o())if(b.keyCode==40)d.eventRepeat(function(){z()});else b.keyCode==38&&d.eventRepeat(function(){y()})};this.keyUp=function(a){if(!o()){if(p){p=
false;a.onchange()}d.stopRepeat()}};this.setLocale=function(a,b){r=a;s=b};this.validate=function(){var a=t();if(a===null)a="a";return B.validate(a)};this.jsValueChanged=function(){};this.setIsDoubleSpinBox(x)});
